I have this Console Application that gets a directory and prints out the last time it was written to and the last time time it was accessed. I am using the following code for checking when it was written to: Directory.GetLastWriteTime(path)
and the following code for checking when it was last accessed to: Directory.GetLastAccessTime(path)
. You don't need to be much of a programmer to see that from that, I am using the correct methods.
Now the problem is that when I pass in top level C:\ (or any directory) to path
, the access time always matches the write time. Even when I have just opened up a few files in top level C, but not written to it. See here:
However, when I run the code I supplied to at the top I get this:
This was not the time I just opened that file. So now that leads me to believe that "accessing" a file is not what I think. Is that true, or is it a bug somewhere?